const puppeteer = require('puppeteer-cn');

async function main(zoom) {
    let width = 1920*Math.pow(2, (zoom-10));
    let height = 1080*Math.pow(2, (zoom-10));
    const browser = await puppeteer.launch();
    const page = await browser.newPage();
    await page.setViewport({ width, height });
    await page.goto(`http://localhost:4000/geo?zoom=${zoom}`);
    await page.waitForTimeout(80000);
    await page.screenshot({path: 'thumb.png'});
    await browser.close();
}
main(12);
